<?php
/**
 * Created by PhpStorm.
 * User: 15814
 * Date: 2018/9/28
 * Time: 20:32
 */
include "config.php";
if ($_SERVER["REQUEST_METHOD"]=="POST"){

        $sql="INSERT INTO `userinfo` (`uTel`,`uPwd`)
         VALUE (?,?);";
        $ready=$conn->prepare($sql);
        $ready->bind_param("ss",$_POST["utel"],$_POST["upwd"]);
        $ready->execute();
        if ($ready->affected_rows>=1){
            print_r(json_encode(array("stu"=>1,"msg"=>"恭喜,注册成功")));
        }
        else{
            print_r(json_encode(array("stu"=>0,"msg"=>"不好意思注册失败")));
        }
        $ready->close();
}
else{
    print_r(json_encode(array("stu"=>-1,"msg"=>"请求方式错误")));
}
$conn->close();